package com.leo.foodmaster.admin.purchase.entity;

import java.time.LocalDate;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.leo.foodmaster.admin.system.dto.OrganDTO;
import com.leo.foodmaster.commons.annotation.Excel;
import com.leo.foodmaster.commons.entity.BaseEntity;
import com.leo.foodmaster.commons.entity.File;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 供应商
 * </p>
 *
 * @author Leo
 * @since 2021-07-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Supplier对象", description="供应商")
@TableName(value = "supplier", autoResultMap = true)
public class Supplier extends BaseEntity implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "所属公司Id")
    private Long organId;

    @ApiModelProperty(value = "供应的公司Id")
    private Long supplyOrganId;

    @ApiModelProperty(value = "电话")
    @Excel(name = "联系电话")
    private String tel;

    @ApiModelProperty(value = "地址")
    @Excel(name = "地址")
    private String address;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "供应商资质")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<File> credentials = new ArrayList<>();

    @ApiModelProperty(value = "资质到期时间")
    private LocalDate expiredDate;

    @ApiModelProperty(value = "是否禁用：0（正常）1（禁用）")
    private String status;

    @ApiModelProperty(value = "打印标签")
    private String label;

    @ApiModelProperty(value = "省编码")
    private String provinceCode;

    @ApiModelProperty(value = "省名称")
    private String provinceName;

    @ApiModelProperty(value = "市编码")
    private String cityCode;

    @ApiModelProperty(value = "市名称")
    private String cityName;

    @ApiModelProperty(value = "区县编码")
    private String areaCode;

    @ApiModelProperty(value = "区县名称")
    private String areaName;

    @TableField(exist = false)
    @ApiModelProperty(value = "供应的公司列表")
    private List<OrganDTO> supplyOrgans;

}
